
var app = getApp();

Page({
    data: {
        id: 0,
        TabCur: 0,
        follows: [],
        follow_count: 0,
    },
    onLoad(options) {
        const id = options.id
        const type = options.type || 'newhouse'
        this.setData({
            id: id
        })
        this.followAndList(id, type)
    },
    onShow() {

    },

    tabSelect(e) {
        this.setData({
            TabCur: e.currentTarget.dataset.id
        })
    },

    followAndList: function(id, type) {

        app.core('get', 'follow/index', {id: id, type: type}, (res) => {
            this.setData({
                follows: res.data.follows,
                follow_count: res.data.count,
            })
        })
    }
})
